package com.dk.controller;

import com.dk.bean.Result;
import com.dk.em.ResultEnum;
import com.dk.pojo.CarMessage;
import com.dk.service.CarMessageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 帅杰
 * @since 2021-08-12 排行榜
 */
@RestController
@RequestMapping("rankingList")
@Api
public class RankingListController {

    @Autowired
    private CarMessageService carMessageService;
    @Autowired
    private RocketMQTemplate rocketMQTemplate;
    @GetMapping
    @ApiOperation(value = "排行榜")
    public Result toSelect(){
        List<CarMessage> messageList=carMessageService.toSelect();
        return Result.buildResult(ResultEnum.SUCCESS).setData(messageList);
    }

}
